package com.ethink.warehouse.api;

import com.ethink.warehouse.api.request.WarehouseStatusSetRequest;
import com.ethink.warehouse.api.response.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RequestParam;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.warehouse.api.info.WarehouseInfo;
import com.ethink.warehouse.api.request.WarehouseAddRequest;
import com.ethink.warehouse.api.request.WarehouseQueryRequest;
import com.ethink.warehouse.api.request.WarehouseUpdateRequest;

import java.util.List;

/**
 * 仓库主仓 Facade接口
 *
 * @author default
 * @date 2022-11-01
 */
@FeignClient(name = "ethink-warehouse-service", path = "warehouse-service/facade/v1/warehouse", contextId = "warehouseFacade")
public interface WarehouseFacade {

    @PostMapping("/queryWarehouse")
    @ResponseBody
    Page<WarehouseInfo> queryWarehouse(@RequestBody WarehouseQueryRequest request);

    @PostMapping("/getWarehouseById")
    @ResponseBody
    WarehouseDetailsResponse getWarehouseById(@RequestParam("warehouseId") Long warehouseId);

    @PostMapping("/listWarehouse")
    @ResponseBody
    List<WarehouseInfo> listWarehouse();

    @PostMapping("/addWarehouse")
    @ResponseBody
    WarehouseAddResponse addWarehouse(@RequestBody WarehouseAddRequest request);

    @PostMapping("/updateWarehouse")
    @ResponseBody
    void updateWarehouse(@RequestBody WarehouseUpdateRequest request);

    @PostMapping("/setWarehouseStatus")
    @ResponseBody
    void setWarehouseStatus(@RequestBody WarehouseStatusSetRequest request);

}